package com.baixiaowen.xiaoaointerview.JVM原理篇;

public class OutOfHeap {

    public static void main(String[] args) throws InterruptedException {
        int[] a = new int[1024 * 1024];
        int[] b = new int[1024 * 1024];
        int[] c = new int[1024 * 1024 * 3];
        a = null;
        b = null;
        c = null;
        Thread.sleep(1000);
        int[] d = new int[1024 * 1024];

        // if you want overflow
        // int[] e = new int[1024 * 1024 * 4];
        System.gc();
    }

}
